export function loadingCamera(options = {}) {
    if (!window.cordova) {
        alert('该功能仅支持在移动设备上运行')
        return
    }
    options = {
        quality: 50,
        destinationType: Camera.DestinationType.DATA_URL,
        sourceType: Camera.PictureSourceType.CAMERA,
        ...options,
    };

    console.log('初始化摄像头');

    // 举例
    return new Promise((resolve, reject) => {
        navigator.camera.getPicture(
            (imageData) => {
                console.log('成功获取图片数据:', imageData);
                resolve(imageData);
            },
            (error) => {
                console.error('摄像头错误:', error);
                reject(error);
            },
            options
        );
    });
}
